package com.css.zfzx.sjcj.modules.yhdisaster.viewobjects;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.css.bpm.platform.utils.PlatformObjectUtils;
import com.css.zfzx.sjcj.modules.yhdisaster.repository.entity.LiveToBuildEnums;

/**
 * <p>评估结果导出</p>
 *
 * @author liuhy
 * @date 2021/8/6
 */
public class DisasterEvaluateVO {

    @Excel(name = "对象编号", width = 15)
    private String yhCode;

    @Excel(name = "使用类别", orderNum = "1", width = 15)
    private String yhProjectType;

    @Excel(name = "原抗震烈度", orderNum = "2", width = 15)
    private String yhEarthIntensity;

    @Excel(name = "现抗震烈度", orderNum = "3", width = 15)
    private String yhNowEarthQh;

    @Excel(name = "评估结果", orderNum = "4", width = 15)
    private String evaluationResult;

    @Excel(name = "抗震设防标准是否达标", orderNum = "5", width = 15)
    private String isUpToStandard;

    @Excel(name = "厂址影响系数", orderNum = "6", width = 15)
    private String rvalue;

    @Excel(name = "承灾体破坏后果影响系数值计算", orderNum = "7", width = 15)
    private String cvalue;

    @Excel(name = "承载体易损性影响系数", orderNum = "8", width = 15)
    private String vvalue;

    @Excel(name = "地震灾害隐患指数", orderNum = "9", width = 15)
    private String pheq;

    @Excel(name = "住建类型", orderNum = "10", width = 15)
    private String liveBuildType;

    public DisasterEvaluateVO(Object data) {
        if (data instanceof Object[]) {
            Object[] d = (Object[]) data;
            this.yhCode = dealNull(d, 0);
            this.yhProjectType = dealNull(d, 1);
            this.yhEarthIntensity = dealNull(d, 2);
            this.yhNowEarthQh = dealNull(d, 3);
            this.evaluationResult = dealNull(d, 4);
            boolean _isUpToStandard;
            Object d4 = d[5];
            if (d4 == null)
                _isUpToStandard = false;
            else
                _isUpToStandard = (boolean) d[5];
            this.isUpToStandard = _isUpToStandard ? "是" : "否";
            this.rvalue = dealNull(d, 6);
            this.cvalue = dealNull(d, 7);
            this.vvalue = dealNull(d, 8);
            this.pheq = dealNull(d, 9);
            String lvTypeCode = dealNull(d, 10);
            if (PlatformObjectUtils.isNotEmpty(lvTypeCode))
                this.liveBuildType = LiveToBuildEnums.getNameByCode(lvTypeCode);
        }
    }

    private String dealNull(Object[] d, int idx) {
        return d[idx] == null ? "" : String.valueOf(d[idx]);
    }

    public String getYhCode() {
        return yhCode;
    }

    public void setYhCode(String yhCode) {
        this.yhCode = yhCode;
    }

    public String getYhProjectType() {
        return yhProjectType;
    }

    public void setYhProjectType(String yhProjectType) {
        this.yhProjectType = yhProjectType;
    }

    public String getYhEarthIntensity() {
        return yhEarthIntensity;
    }

    public void setYhEarthIntensity(String yhEarthIntensity) {
        this.yhEarthIntensity = yhEarthIntensity;
    }

    public String getYhNowEarthQh() {
        return yhNowEarthQh;
    }

    public void setYhNowEarthQh(String yhNowEarthQh) {
        this.yhNowEarthQh = yhNowEarthQh;
    }

    public String getEvaluationResult() {
        return evaluationResult;
    }

    public void setEvaluationResult(String evaluationResult) {
        this.evaluationResult = evaluationResult;
    }

    public String getIsUpToStandard() {
        return isUpToStandard;
    }

    public void setIsUpToStandard(String isUpToStandard) {
        this.isUpToStandard = isUpToStandard;
    }

    public String getRvalue() {
        return rvalue;
    }

    public void setRvalue(String rvalue) {
        this.rvalue = rvalue;
    }

    public String getCvalue() {
        return cvalue;
    }

    public void setCvalue(String cvalue) {
        this.cvalue = cvalue;
    }

    public String getVvalue() {
        return vvalue;
    }

    public void setVvalue(String vvalue) {
        this.vvalue = vvalue;
    }

    public String getPheq() {
        return pheq;
    }

    public void setPheq(String pheq) {
        this.pheq = pheq;
    }

    public String getLiveBuildType() {
        return liveBuildType;
    }

    public void setLiveBuildType(String liveBuildType) {
        this.liveBuildType = liveBuildType;
    }
}
